package com.coocaa.app.lib.cleaner.deleter.other;

import android.content.Context;

import com.coocaa.app.lib.cleaner.deleter.AbstractDeleter;
import com.coocaa.app.lib.cleaner.deleter.other.impl.OtherDataDeleterImpl;

import java.util.List;

/**
 * Created by lu on 17-4-13.
 */

public abstract class OtherDataDeleterFactory {

    /**
     * Created by lu on 17-4-13.
     */

    public interface OtherDataDeleter extends AbstractDeleter {
        interface OtherDataDeleterListener {
            void onOtherDeleteStart();

            void onOtherDataDeleteEnd(boolean result, long size);
        }

        void delete(Context context, List<String> datas, OtherDataDeleterListener listener);
    }


    public static final OtherDataDeleterFactory factory = new OtherDataDeleterFactory() {
        private OtherDataDeleter deleter = null;


        @Override
        public OtherDataDeleter create() {
            return new OtherDataDeleterImpl();
        }

        @Override
        public synchronized OtherDataDeleter instance() {
            if (deleter == null)
                deleter = create();
            return deleter;
        }
    };

    public abstract OtherDataDeleter create();

    public abstract OtherDataDeleter instance();
}
